package com.apexedu.biz.action;

import com.apexedu.biz.entity.TAccessAppReg;
import com.apexedu.framework.service.BaseService;
import com.apexedu.framework.util.DBUtil;
import com.apexedu.sys.action.AbstractBaseActionSupport;
import com.apexedu.sys.entity.ApplicationEnum;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 业务系统登记模块
 * date:2013.10.10
 * user:liuxu
 */
@SuppressWarnings("serial")
@Component
@Scope("prototype")
public class SystemListAction extends AbstractBaseActionSupport {

	 /**
     * 此方法植入service类
     */
    @Resource(name="systemListService")
    public void setBaseService(BaseService baseService){
        super.setBaseService(baseService);
    }

    private TAccessAppReg accessAppReg;

    public TAccessAppReg getAccessAppReg() {
        return accessAppReg;
    }

    public void setAccessAppReg(TAccessAppReg accessAppReg) {
        this.accessAppReg = accessAppReg;
    }

    public String execute(){
        return toView("execute.jsp");
    }

    /**
     * 获取
     * @return
     */
    public List<ApplicationEnum> getDbs() {
        List<ApplicationEnum> dbs = DBUtil.queryAllBeanList("select a.code as id,a.name as caption from t_db a" +
                " where a.state='1' order by a.wid ", ApplicationEnum.class);
        return dbs;
    }

}
